class_name HarmHandle  extends Resource

var item:CanvasItem

func handle_harm(value:int,type:String = "") -> int:
	var harm_label = preload("res://塔防/伤害数字/harm_label.tscn").instantiate()
	Global.umg.add_child(harm_label)
	var tran = item.get_canvas_transform()
	harm_label.position = tran * item.global_position
	harm_label.set_text(str(value))
	harm_label.颜色 = _get_color(type)
	harm_label.playAnim()
	return value

func _get_color(type:String) -> Color:
	if type == "毒":
		return Color(0.754, 0, 0.682)
	elif type == "冰":
		return Color("#154FF9")
	else:
		return Color(1, 1, 1)
